pub fn min_subsequence(mut nums: Vec<i32>) -> Vec<i32> {
    nums.sort_by(|a, b| b.cmp(&a));
    let total = nums.iter().sum::<i32>();
    let mut sum = 0;
    for i in 0..nums.len() {
        sum += nums[i];
        if total - sum < sum {
            return nums[0..=i].to_vec();
        }
    }
    vec![]
}

#[test]
fn test_min_subsequence() {
    println!("res {0:?}", min_subsequence(vec![4, 3, 10, 9, 8]));
    println!("res {0:?}", min_subsequence(vec![4, 4, 7, 6, 7]));
    println!("res {0:?}", min_subsequence(vec![6]));
}
